<template>
  <li class="commodity-item clearfix">
    <div class="img-container">
      <a :href="'#/mall/good-list/'+value.id"><img :src="value.pic"/></a>
    </div>
    <div class="commodity-item-info">
      <div class="name"><a :href="'#/mall/good-list/'+value.id">{{value.title}}</a></div>
      <div class="description">简介：<span class="intro">{{value.intro | getSimpleText}}</span></div>
      <!-- v-html="value.intro" -->
      <div class="price">
        <span class="price1">¥{{value.price}}</span>
      </div>
    </div>
  </li>
</template>

<script>
import book3 from '@/assets/mock_images/book3.png'
export default {
  name: 'commodityItem',
  data() {
    return {
      book3
    }
  },
  props: {
    value: {
      type: Object,
      default: function() { return { /*  */ } }
    }
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
@import '../../styles/mixin.scss';
.commodity-item{
  padding: 30px 0;
  border-bottom: 1px solid #e5e6e7;
  &:last-child{
    border-bottom: 0;
  }
  .img-container{
    width: 190px;
    height: 190px;
    float: left;
    text-align: center;
    overflow: hidden;
    img{
      width: 100%;
      height: 100%;
    }
  }
  .commodity-item-info{
    float: left;
    margin-left: 10px;
    width: 678px;
    .name{
      font-size: 18px;
      font-weight: bold;
      @include ellipsisLn(2);
      >a{
        &:hover{
          color: #00A2EA;
          text-decoration: underline;
        }
      }
    }
    .author{
      font-size: 12px;
      color: #999;
      margin: 10px 0;
    }
    .rate-container{
      >div{
        display: inline-block;
        vertical-align: middle;
      }
      >span{
        color: #EF7401;
        font-size: 16px;
        font-weight: 500;
      }
    }
    .description{
      margin: 10px 0;
      color: #333;
      font-size: 12px;
      @include ellipsisLn(4)
      // .intro{
      //   display: inline-block;
      //   height: 75px;
      //   overflow: hidden;
      // }
    }
    .price{
      .price1{
        font-size: 22px;
        color: #EF6401;
      }
      .price2{
        color: #999;
        text-decoration:line-through;
      }
      .discount{
        color: #999;
      }
    }
  }
}
</style>